Spark plugs provided with an electrode including a tip are conventionally used. The tip of the electrode is joined to a base portion, which is a member supporting the tip, by welding or the like. During welding, in some cases, a metal piece, also referred to spatter, adheres to a joining portion to form a protruding portion. There have been proposed techniques for detecting such a protruding portion by using a captured image (see, for example, Japanese Patent Application Laid-open No. 2004-214218). Specifically, an image of a joining work member is captured by using an image capturing means to obtain a captured image. An outline of an outer surface of the joining work member in the captured image and a reference outline are used to check whether the outline of the joining work member is present within a non-allowed region around the reference outline. If the presence of the outline of the joining work member within the non-allowed region is confirmed, it is determined that a protruding portion is present.
A surface of a member to be welded, such as a tip, may include an unintended color portion such as a portion with stains, a portion having scratches, or an oxidized portion. Such a portion may cause a wrong outline to be identified in the captured image, resulting in a reduction in detection accuracy in some cases. This issue is an issue that is not specific to when a protruding portion is detected by using the outline but common to when the presence or absence of joining deficiency of the electrode is determined.